import { BASE_URL, TIME_OUT } from "./config";
import HYRequest from "./request";

export const hyRequest = new HYRequest({
    baseURL: BASE_URL,
    timeout: TIME_OUT
})

export const  hyRequest2 = new HYRequest({
    baseURL: 'http://codercba.com:1888/airbnb/api',
    timeout: 8000,

    interceptors: {
        requestSuccessFn: (config) => {
            console.log('拦截');
            return config
        },
        requestFailureFn: (err) => {
            console.log('失败请求');
            return err
        },
        responseSuccessFn: (res) => {
            console.log('响应成功');
            return res
        },
        responseFailureFn: (err) => {
            console.log('响应失败');
            return err
        }
    }

})